package com.qianfeng.freeshiro.controller;

import com.qianfeng.freeshiro.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
public class AuthController {
    @Resource
    private UserService userService;

    @RequestMapping("/login")
    public String login2(){
        return "/login";
    }

    @RequestMapping("/")
    public String login(){
        return "/login";
    }

    @RequestMapping("/doLogin")
    public String doLogin(String userNumber, String password){
        userService.login(userNumber, password);
        return "/home";
    }
}
